package cn.wit.test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class DemoResponse extends HttpServlet{
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	
		//设置编码 把字符串转成字节的时候，使用什么编码
		resp.setContentType("text/html;charset=utf-8");
		resp.setHeader("token", "123sdhsdh");
		
		//往浏览器输出内容
		PrintWriter writer = resp.getWriter();
		
		writer.write("<html>");
		
		writer.write("<body>");
		
		writer.write("<h3>中</h3>");
		
		writer.write("</body>");
		
		writer.write("</html>");
		
	}

}
